package com.yueka.service.Impl;

import com.yueka.mapper.HonorMapper;
import com.yueka.pojo.honor.Honor;
import com.yueka.service.HonorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class HonorServiceImpl implements HonorService {
    @Autowired
    private HonorMapper honorMapper;
    @Override
    public List<Honor> list() {
        return honorMapper.list();
    }

    @Override
    public void insert(Honor honor) {
        honor.setUpdateTime(LocalDateTime.now());
        honor.setCreateTime(LocalDateTime.now());
        honorMapper.insert(honor);
    }

    @Override
    public void update(Honor honor) {
        honor.setUpdateTime(LocalDateTime.now());
        honorMapper.update(honor);
    }

    @Override
    public void delete(Integer id) {
        honorMapper.delete(id);
    }
}
